<div class="panes_vertical">
	<div class="box">	
		
		<form method="post" action="<{$APPLICATION_URL}>/Admin/User/edit/id/<{$id}>" name="frmForm" enctype="multipart/form-data">		
		
		
			<fieldset>
				<p>
					<label>Loại:</label>
					<select name="userType" id="userType">
						<option value='-1'>-- Select one --</option>
						
						<{html_options options = $aUserType selected=$userType}>
					</select>
				</p>
				<p>
					<label>Họ tên:</label>
					<input type='text' id='fullname' name='fullname' value='<{$fullname}>' class="textfield">					
				</p>
				<p>
					<label>Email:</label>
					<input type='text' id='email' name='email' value='<{$email}>' class="textfield">					
				</p>
				<p>
					<label>Mật khẩu:</label>
					<input type='password' id='password' name='password' value='' class="textfield">					
				</p>
				<p>
					<label>Ngày sinh:</label>
					<input class='date' type='text' id='birthday' name='birthday' value='<{$birthday}>' class="textfield" size="10">					
				</p>
				<p>
					<label>Địa chỉ:</label>
					<input type='text' id='address' name='address' value='<{$address}>' class="textfield" size="10">					
				</p>
				<p>
					<label>Điện thoại:</label>
					<input type='text' id='phone' name='phone' value='<{$phone}>' class="textfield">					
				</p>
				<p>
					<label>Giới tính</label>
					<select style="width:78px;" autocomplete="off" id="ddlDate" name="gender">
				<option value="male" <{if $gender=="male" }> selected <{/if}>>Nam</option>
                <option value="female" <{if $gender=="female" }> selected <{/if}>>Nữ</option>
				</select>
				</p>
				<p>
					<label>Hình đại diện:</label>
					<input type='file' id='picture' name='picture' value='<{$picture}>' class="textfield">					
				</p>				
				<p>
					<label>Trạng thái:</label>
					<select name="status" id="select">
						<option value=''>-- Select one --</option>
						<{html_options options = $status selected=$status}>
					</select>
				</p>
				<p> 
					<input type="submit" name="submit" class="button" id="save" value=" Thêm " onclick="formSubmit();" />
					<input type="reset" name="reset" class="button" id="reset" value=" Hủy " />										
					<input type="hidden" id="actionForm" name="actionForm" value=""/>
					<input type="hidden" id="actionKey" name="actionKey" value="<{$actionKey}>" />
				</p>
			</fieldset>
		</form>
	</div>
</div>

<script type="text/javascript">
    function formSubmit()
    {
    	var theform = document.frmForm;
    	
    	// Check Name
    	var fullname = theform.fullname.value;
    	if (fullname == ''){
			alert('Name is invalid');
			theform.fullname.focus();
			return false;
    	} 	
		
		// Check Name
    	/*var password = theform.password.value;
		var retypePassword = theform.retypePassword.value;
    	if (password == ''){
			alert('Password is missing');
			theform.password.focus();
			return false;
    	}
		else 
		{
			if(retypePassword != password)
			{
				alert('Password is mismatched!');
				theform.password.focus();
				return false;
			}
		}
		*/
		// Check Name
    	var email = theform.email.value;
    	if (email == ''){
			alert('Email is missing');
			theform.email.focus();
			return false;
    	}

    	// Check status
    	/*var status = theform.status.value;
    	if (status == ''){
			alert('Status is invalid');
			theform.status.focus();
			return false;
    	}
		*/
    	theform.actionForm.value = 'submit';
    	theform.submit();
    	return true;
    }
    var date = new Date();
    var currentMonth = date.getMonth();
    var currentDate = date.getDate();
    var currentYear = date.getFullYear();
    $('.date').datepicker({
    	constrainInput: true,
    	dateFormat: 'yy-mm-dd',
        maxDate: new Date(currentYear, currentMonth, currentDate)
    });
</script>